package com.briup.serviceImp;

import com.briup.dao.CategoryMapper;
import com.briup.pojo.Category;
import com.briup.service.ICategotyService;
import com.briup.utils.ToolMan;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class CategoryServiceImp implements ICategotyService {
    @Override
    public List<Category> findAllCategories() {
        SqlSession sqlSession = ToolMan.getSqlSession();
        CategoryMapper mapper = sqlSession.getMapper(CategoryMapper.class);
        List<Category> allCategories = mapper.findAllCategories();
        sqlSession.close();
        return allCategories;


    }
}
